package com.czxy.rbac;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

@Data
@TableName("sys_permission")
public class SysPermission {
  @TableId(value = "id", type = IdType.AUTO)
  private Integer id;
  @TableField("permName")
  private String permName;
  @TableField("parent_id")
  private Integer parentId;
  @TableField("path")
  private String path;

  @TableField(exist = false)
  @JsonInclude(JsonInclude.Include.NON_EMPTY)
  public Set<SysPermission> children = new HashSet<>();

}

